﻿using System.Runtime.Serialization;

namespace Conducido.BizTalkOppSvc.Services.Contracts.BtsTypes
{
    /// <summary>
    /// For more information on all possible instance statussen see the page:
    /// http://msdn.microsoft.com/en-us/library/microsoft.biztalk.operations.instancestatus(v=BTS.20).aspx
    /// These enumeration items are best on <see cref="http://msdn.microsoft.com/en-us/library/microsoft.biztalk.operations.instancestatus(v=BTS.20).aspx"/>
    /// 
    /// </summary>
    [DataContract(Namespace = "http://schemas.conducido.nl/BizTalkOpSuite/BtsOperationInfo/2012/01")]
    public enum BtInstanceStatus
    {
        /// <summary>
        /// An active service instance either performing work on a message in the message box database or waiting for work. 
        /// If the instance is in the tracking database, this status indicates the instance is in progress.
        /// </summary>
        [EnumMember]
        Active =0,

        /// <summary>
        /// All service instance states.
        /// </summary>
        [EnumMember]
        All = 10,

        /// <summary>
        /// A successfully completed service instance. The tracking database recorded the event for later reference.
        /// </summary>
        [EnumMember]
        Completed = 20,

        /// <summary>
        /// An orchestration service instance that has been written disk rather than kept in memory.
        /// </summary>
        [EnumMember]
        Dehydrated = 30,

        /// <summary>
        /// No instance status.
        /// </summary>
        [EnumMember]
        None =40,

        /// <summary>
        /// A service instance that is ready to begin processing but the BizTalk Server service has not started.
        /// </summary>
        [EnumMember]
        ReadyToRun = 50,

        /// <summary>
        /// Reserved for use by Windows Management Instrumentation (WMI).
        /// </summary>
        [EnumMember]
        Reserved1 = 60,

        /// <summary>
        /// All service instances that are not in a suspended state.
        /// </summary>
        [EnumMember]
        RunningAll = 70,

        /// <summary>
        /// A send port instance that is not yet able to send messages.
        /// </summary>
        [EnumMember]
        Scheduled = 80,

        /// <summary>
        /// A suspended service instance that causes messages to be queued until the service instance resumes processing.
        /// (Suspended Resumable)
        /// </summary>
        [EnumMember]
        Suspended = 90,

        /// <summary>
        /// All suspended service states for message box service instances.
        /// </summary>
        [EnumMember]
        SuspendedAll = 100,

        /// <summary>
        /// A service instance that is suspended but cannot be resumed, unlike the Suspended service instance. 
        /// Typically, these instances can only be terminated in the business process.
        /// </summary>
        [EnumMember]
        SuspendedNotResumable = 110,

        /// <summary>
        /// A message box service instance has failed and the tracking database denotes this state for the instance.
        /// </summary>
        [EnumMember]
        Terminiated = 120
    }
}
